Optimal. Leaf size=168 \[ a \left (a^2-3 b^2\right ) x+\frac {b \left (3 a^2-b^2\right ) \log (\cos (c+d x))}{d}+\frac {3 a b^2 \tan (c+d x)}{d}+\frac {b \left (3 a^2-b^2\right ) \tan ^2(c+d x)}{2 d}-\frac {a b^2 \tan ^3(c+d x)}{d}+\frac {b^3 \tan ^4(c+d x)}{4 d}+\frac {3 a b^2 \tan ^5(c+d x)}{5 d}-\frac {b^3 \tan ^6(c+d x)}{6 d}+\frac {b^3 \tan ^8(c+d x)}{8 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 168, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {3742, 1824,
649, 209, 266} \begin {gather*} \frac {b \left (3 a^2-b^2\right ) \tan ^2(c+d x)}{2 d}+\frac {b \left (3 a^2-b^2\right ) \log (\cos (c+d x))}{d}+a x \left (a^2-3 b^2\right )+\frac {3 a b^2 \tan ^5(c+d x)}{5 d}-\frac {a b^2 \tan ^3(c+d x)}{d}+\frac {3 a b^2 \tan (c+d x)}{d}+\frac {b^3 \tan ^8(c+d x)}{8 d}-\frac {b^3 \tan ^6(c+d x)}{6 d}+\frac {b^3 \tan ^4(c+d x)}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 266
Rule 649
Rule 1824
Rule 3742
Rubi steps
\begin {align*} \int \left (a+b \tan ^3(c+d x)\right )^3 \, dx &=\frac {\text {Subst}\left (\int \frac {\left (a+b x^3\right )^3}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \left (3 a b^2+b \left (3 a^2-b^2\right ) x-3 a b^2 x^2+b^3 x^3+3 a b^2 x^4-b^3 x^5+b^3 x^7+\frac {a^3-3 a b^2-b \left (3 a^2-b^2\right ) x}{1+x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {3 a b^2 \tan (c+d x)}{d}+\frac {b \left (3 a^2-b^2\right ) \tan ^2(c+d x)}{2 d}-\frac {a b^2 \tan ^3(c+d x)}{d}+\frac {b^3 \tan ^4(c+d x)}{4 d}+\frac {3 a b^2 \tan ^5(c+d x)}{5 d}-\frac {b^3 \tan ^6(c+d x)}{6 d}+\frac {b^3 \tan ^8(c+d x)}{8 d}+\frac {\text {Subst}\left (\int \frac {a^3-3 a b^2-b \left (3 a^2-b^2\right ) x}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {3 a b^2 \tan (c+d x)}{d}+\frac {b \left (3 a^2-b^2\right ) \tan ^2(c+d x)}{2 d}-\frac {a b^2 \tan ^3(c+d x)}{d}+\frac {b^3 \tan ^4(c+d x)}{4 d}+\frac {3 a b^2 \tan ^5(c+d x)}{5 d}-\frac {b^3 \tan ^6(c+d x)}{6 d}+\frac {b^3 \tan ^8(c+d x)}{8 d}+\frac {\left (a \left (a^2-3 b^2\right )\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}-\frac {\left (b \left (3 a^2-b^2\right )\right ) \text {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=a \left (a^2-3 b^2\right ) x+\frac {b \left (3 a^2-b^2\right ) \log (\cos (c+d x))}{d}+\frac {3 a b^2 \tan (c+d x)}{d}+\frac {b \left (3 a^2-b^2\right ) \tan ^2(c+d x)}{2 d}-\frac {a b^2 \tan ^3(c+d x)}{d}+\frac {b^3 \tan ^4(c+d x)}{4 d}+\frac {3 a b^2 \tan ^5(c+d x)}{5 d}-\frac {b^3 \tan ^6(c+d x)}{6 d}+\frac {b^3 \tan ^8(c+d x)}{8 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.30, size = 160, normalized size = 0.95 \begin {gather*} \frac {60 \left (-i (a-i b)^3 \log (i-\tan (c+d x))+i (a+i b)^3 \log (i+\tan (c+d x))\right )+360 a b^2 \tan (c+d x)-60 b \left (-3 a^2+b^2\right ) \tan ^2(c+d x)-120 a b^2 \tan ^3(c+d x)+30 b^3 \tan ^4(c+d x)+72 a b^2 \tan ^5(c+d x)-20 b^3 \tan ^6(c+d x)+15 b^3 \tan ^8(c+d x)}{120 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 153, normalized size = 0.91
method | result | size |
derivativedivides | \(\frac {\frac {b^{3} \left (\tan ^{8}\left (d x +c \right )\right )}{8}-\frac {b^{3} \left (\tan ^{6}\left (d x +c \right )\right )}{6}+\frac {3 a \,b^{2} \left (\tan ^{5}\left (d x +c \right )\right )}{5}+\frac {b^{3} \left (\tan ^{4}\left (d x +c \right )\right )}{4}-a \,b^{2} \left (\tan ^{3}\left (d x +c \right )\right )+\frac {3 a^{2} b \left (\tan ^{2}\left (d x +c \right )\right )}{2}-\frac {b^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{2}+3 a \,b^{2} \tan \left (d x +c \right )+\frac {\left (-3 a^{2} b +b^{3}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (a^{3}-3 a \,b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(153\) |
default | \(\frac {\frac {b^{3} \left (\tan ^{8}\left (d x +c \right )\right )}{8}-\frac {b^{3} \left (\tan ^{6}\left (d x +c \right )\right )}{6}+\frac {3 a \,b^{2} \left (\tan ^{5}\left (d x +c \right )\right )}{5}+\frac {b^{3} \left (\tan ^{4}\left (d x +c \right )\right )}{4}-a \,b^{2} \left (\tan ^{3}\left (d x +c \right )\right )+\frac {3 a^{2} b \left (\tan ^{2}\left (d x +c \right )\right )}{2}-\frac {b^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{2}+3 a \,b^{2} \tan \left (d x +c \right )+\frac {\left (-3 a^{2} b +b^{3}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (a^{3}-3 a \,b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(153\) |
norman | \(\left (a^{3}-3 a \,b^{2}\right ) x +\frac {b^{3} \left (\tan ^{4}\left (d x +c \right )\right )}{4 d}-\frac {b^{3} \left (\tan ^{6}\left (d x +c \right )\right )}{6 d}+\frac {b^{3} \left (\tan ^{8}\left (d x +c \right )\right )}{8 d}+\frac {3 a \,b^{2} \tan \left (d x +c \right )}{d}-\frac {a \,b^{2} \left (\tan ^{3}\left (d x +c \right )\right )}{d}+\frac {3 a \,b^{2} \left (\tan ^{5}\left (d x +c \right )\right )}{5 d}+\frac {b \left (3 a^{2}-b^{2}\right ) \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}-\frac {b \left (3 a^{2}-b^{2}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) | \(164\) |
risch | \(-3 i a^{2} b x +i b^{3} x +a^{3} x -3 a \,b^{2} x -\frac {6 i b \,a^{2} c}{d}+\frac {2 i b^{3} c}{d}-\frac {2 b \left (-2229 i a b \,{\mathrm e}^{6 i \left (d x +c \right )}-45 a^{2} {\mathrm e}^{14 i \left (d x +c \right )}+60 b^{2} {\mathrm e}^{14 i \left (d x +c \right )}-69 i a b -270 a^{2} {\mathrm e}^{12 i \left (d x +c \right )}+180 b^{2} {\mathrm e}^{12 i \left (d x +c \right )}-675 i a b \,{\mathrm e}^{12 i \left (d x +c \right )}-675 a^{2} {\mathrm e}^{10 i \left (d x +c \right )}+500 b^{2} {\mathrm e}^{10 i \left (d x +c \right )}-135 i a b \,{\mathrm e}^{14 i \left (d x +c \right )}-900 a^{2} {\mathrm e}^{8 i \left (d x +c \right )}+520 b^{2} {\mathrm e}^{8 i \left (d x +c \right )}-1635 i a b \,{\mathrm e}^{10 i \left (d x +c \right )}-675 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}+500 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-1257 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-270 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+180 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-417 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}-45 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+60 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-2415 i a b \,{\mathrm e}^{8 i \left (d x +c \right )}\right )}{15 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{8}}+\frac {3 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) a^{2}}{d}-\frac {b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(410\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.52, size = 183, normalized size = 1.09 \begin {gather*} a^{3} x + \frac {{\left (3 \, \tan \left (d x + c\right )^{5} - 5 \, \tan \left (d x + c\right )^{3} - 15 \, d x - 15 \, c + 15 \, \tan \left (d x + c\right )\right )} a b^{2}}{5 \, d} + \frac {b^{3} {\left (\frac {48 \, \sin \left (d x + c\right )^{6} - 108 \, \sin \left (d x + c\right )^{4} + 88 \, \sin \left (d x + c\right )^{2} - 25}{\sin \left (d x + c\right )^{8} - 4 \, \sin \left (d x + c\right )^{6} + 6 \, \sin \left (d x + c\right )^{4} - 4 \, \sin \left (d x + c\right )^{2} + 1} - 12 \, \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )}}{24 \, d} - \frac {3 \, a^{2} b {\left (\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.78, size = 148, normalized size = 0.88 \begin {gather*} \frac {15 \, b^{3} \tan \left (d x + c\right )^{8} - 20 \, b^{3} \tan \left (d x + c\right )^{6} + 72 \, a b^{2} \tan \left (d x + c\right )^{5} + 30 \, b^{3} \tan \left (d x + c\right )^{4} - 120 \, a b^{2} \tan \left (d x + c\right )^{3} + 360 \, a b^{2} \tan \left (d x + c\right ) + 120 \, {\left (a^{3} - 3 \, a b^{2}\right )} d x + 60 \, {\left (3 \, a^{2} b - b^{3}\right )} \tan \left (d x + c\right )^{2} + 60 \, {\left (3 \, a^{2} b - b^{3}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right )}{120 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.30, size = 194, normalized size = 1.15 \begin {gather*} \begin {cases} a^{3} x - \frac {3 a^{2} b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {3 a^{2} b \tan ^{2}{\left (c + d x \right )}}{2 d} - 3 a b^{2} x + \frac {3 a b^{2} \tan ^{5}{\left (c + d x \right )}}{5 d} - \frac {a b^{2} \tan ^{3}{\left (c + d x \right )}}{d} + \frac {3 a b^{2} \tan {\left (c + d x \right )}}{d} + \frac {b^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {b^{3} \tan ^{8}{\left (c + d x \right )}}{8 d} - \frac {b^{3} \tan ^{6}{\left (c + d x \right )}}{6 d} + \frac {b^{3} \tan ^{4}{\left (c + d x \right )}}{4 d} - \frac {b^{3} \tan ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a + b \tan ^{3}{\left (c \right )}\right )^{3} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 3125 vs.
\(2 (158) = 316\).
time = 8.07, size = 3125, normalized size = 18.60 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.60, size = 174, normalized size = 1.04 \begin {gather*} \frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {3\,a^2\,b}{2}-\frac {b^3}{2}\right )+\frac {b^3\,{\mathrm {tan}\left (c+d\,x\right )}^4}{4}-\frac {b^3\,{\mathrm {tan}\left (c+d\,x\right )}^6}{6}+\frac {b^3\,{\mathrm {tan}\left (c+d\,x\right )}^8}{8}-\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )\,\left (\frac {3\,a^2\,b}{2}-\frac {b^3}{2}\right )-a\,\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (c+d\,x\right )\,\left (a^2-3\,b^2\right )}{3\,a\,b^2-a^3}\right )\,\left (a^2-3\,b^2\right )-a\,b^2\,{\mathrm {tan}\left (c+d\,x\right )}^3+\frac {3\,a\,b^2\,{\mathrm {tan}\left (c+d\,x\right )}^5}{5}+3\,a\,b^2\,\mathrm {tan}\left (c+d\,x\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________